% @author:夜剑听雨
% E-mail:2530595378@qq.com
% 2025.08.29
% 将seg2格式转换为mat格式
clear;close all;
% 读取seg2数据,这里必须使用单引号，否则会报错
data  = seg2read('./data/data_seg2/shot3.seg2');

shot_ZZ = data;    % ZZ分量数据

figure;wigb(shot_ZZ)

% 偏移距
offset = 10;
% 道间距
dx = 1;
% 采样率
fs = 2000;

fileName= "shot3.mat";
%% 将参数写入结构体，保存结构体数据
shot = [];
shot.times = '1s';      % 采集时间长度
shot.dt = 1/fs;         % 采样时间间隔
shot.offset = offset;
shot.dx = dx;
shot.ZZ = shot_ZZ;


%% 保存数据
outputFolder = './data/data_mat';
% 创建输出文件夹
if ~exist(outputFolder, 'dir')
    mkdir(outputFolder);
end
savePath = fullfile(outputFolder,fileName);
save(savePath, "shot")

